
import tomAndJerry from '../../images/tom-jerry.webp';

import { Component } from 'react';

class Cat extends Component {

    render(){
        // 从 props 中获取 mouse
        const mouse = this.props.mouse;

        const styles = { 
            left: mouse.x, 
            top: mouse.y ,
        }

        return (
            <div className="cat-wrapper">
                <img src={ tomAndJerry } style={ styles } />
            </div>
        )
    }
}

export default Cat ;